package com.slt.android.osmessageandsecurity;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.widget.TextView;

/**
 * Created by dp on 2018/1/31.
 */

public class SeceondActiviy extends Activity {
    TextView tv;
    PackageManager pm;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
        tv = (TextView) findViewById(R.id.tv);
        getIntentData();

    }

    private void getIntentData() {
        Intent i = getIntent();
        pm = getPackageManager();
        ResolveInfo info = pm.resolveActivity(i , PackageManager.MATCH_DEFAULT_ONLY);
        if (info != null) {
            String str = info.activityInfo.targetActivity;
            tv.setText(str);
        }
    }
}
